<template>
	<view class="content">
		<u-navbar bgColor="transparent" titleStyle="color:#fff" title="工厂工卡详情" leftIconColor="#fff" :autoBack="true"
			:placeholder="false">
		</u-navbar>
		<view class="content-top">
			<view style="height: 124rpx;"></view>
		</view>
		<view class="details-box">
			<image class="details-img" src="https://web.sunsk.top/upload/mutualaid/mutualaid/thumbnail/20240525/688f8e6e995fd591bfe7d390c67de7e0.png" mode=""></image>
			<view class="details-title">
				<view>
					A级工厂工卡
				</view>
				<view class="price">
					<text>288.00 </text>云矿石
				</view>
			</view>
			<view class="title">
				选择规格
			</view>
			<view class="check-box">
				<view class="item" @click="gocheck(x)" :class="i.check == true?'check-true':''" v-for="(i,x) in typeall"
					:key="x">{{i.name}}</view>
			</view>
			<view class="title">
				工卡说明
			</view>
			<view class="explain">
				<view class="explain-text">
					所有工卡可以相互转换
				</view>
				<view class="explain-text">
					购买工卡完成后可开始使用
				</view>
			</view>
			<view style="height: 50rpx;"></view>
			<view class="work-btn">
				<u-button color="#563AFD" type="primary" @click="clickgz" :text="'立即购买('+numpir+'云矿石)'"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				typeall: [{
						name: '100张',
						num: 100,
						check: true
					},
					{
						name: '200张',
						num: 200,
						check: false
					}
				],
				numpir: 28800,
			}
		},
		methods: {
			clickgz(){
				uni.navigateTo({
					url:'/pages/factory/pay_info/index?num='+this.numpir
				})
			},
			gocheck(index) {
				this.typeall.map(item => {
					item.check = false
				}, 1000)
				this.typeall[index].check = true
				this.numpir = 288 * this.typeall[index].num
			},
		}
	}
</script>
<style>
	page {
		background: #250F5A;
	}
</style>
<style lang="scss" scoped>
	.content-top {
		width: 100%;
		height: 200rpx;
		background: linear-gradient(90deg, #513AFD 0%, #F42FF9 54%, #F85B9F 100%);
		color: #fff;
	}

	.details-box {
		margin-top: -80rpx;
		padding: 30rpx;
		background-color: #250F5A;
		border-top-right-radius: 30rpx;
		border-top-left-radius: 30rpx;

		.details-img {
			width: 686rpx;
			height: 686rpx;
		}

		.details-title {
			margin-top: 30rpx;
			color: #fff;
			font-size: 40rpx;
			font-weight: 600;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.price {
				font-size: 24rpx;
				color: #F53CDE;

				text {
					font-weight: 600;
					font-size: 48rpx;
				}
			}
		}

		.title {
			padding: 30rpx 0;
			font-weight: bold;
			font-size: 32rpx;
			color: #FFFFFF;
		}


		.check-box {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.item {
				width: 48%;
				height: 80rpx;
				line-height: 80rpx;
				background: rgba(246, 67, 209, 0.16);
				text-align: center;
				font-size: 28rpx;
				color: #FFFFFF;
				border-radius: 10rpx;
			}

			.check-true {
				background: #F53CDE;
			}
		}

		.explain {
			padding: 30rpx;
			background-color: rgba(255, 255, 255, .05);
			border-radius: 30rpx;

			.explain-text {
				color: #999;
				margin-bottom: 20rpx;
				font-size: 24rpx;
			}

			.explain-text:last-child {
				margin-bottom: 0;
			}
		}
	}
</style>